package java0.homework;

import java0.homework.pojo.School;
import java0.homework.pojo.Student;
import java0.homework.pojo.XSchool;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class HomeWork05Application {



	public static void main(String[] args) {
		ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(HomeWork05Application.class).web(WebApplicationType.SERVLET).run(args);


		Student student = applicationContext.getBean(Student.class);
		System.out.println("第一种方式 @Bean 获取" + student);
		School school = applicationContext.getBean(School.class);
		System.out.println("第一种方式 @Component 获取" + school);
		// todo xml
		XSchool xSchool = applicationContext.getBean(XSchool.class);
		System.out.println("自动装配 05homework-spring-boot-starter 获取" + xSchool);
	}

}
